﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DPS.DataModel;

namespace DPS.Prototype.Model.Adapter
{
    public class WorkOrderAdapter
    {
        public static WorkOrder Adapter(DPSWorkOrderByBatchT workOrderModel)
        {
            WorkOrder order = new WorkOrder();
            order.OrderNo = workOrderModel.WONo;
            order.PlantCode = workOrderModel.Owner;
            order.Sku =new Sku(workOrderModel.SKUNo);
            order.SalesOrder = new SalesOrder() { SONo = workOrderModel.SONo };
            order.OrderQty = (float)workOrderModel.WOQty;
            order.FilishedQty = (float)workOrderModel.FinishedQty;
            order.OpenOrderQty = (float)workOrderModel.OpenQty;
            order.GIDate = (DateTime)workOrderModel.SOETD;
            order.CreateDate = (DateTime)workOrderModel.WOCreateDate;
            order.Model = workOrderModel.Model;
            return order;
        }
    }
}
